-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delay cmj optimizations #475
base: main
Are you sure you want to change the base?
Conversation
The diff looks a lot better with https://github.com/melange-re/melange/pull/475/files?w=1 |
Even if the benchmarks look good, the main impact on perf for these changes is that more code will be bundled by webpack or other js bundlers unnecessarily, right? So, the trade-off will be between build speed and bundle size? I am asking to clarify this because I believe that if one uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: the deoptimization:
the reason for this is that the cmj file needs to store whether the current module is side-effectful, and that depends on other .cmj files too. So we can't just do it when emitting the .js
Would it be possible to store at cmj-generation time the other cmjs info required to calculate the "purity" at cmj-time, and use it later at js-generation time?
jscomp/core/lam_compile_main.ml
Outdated
(lam : Lambda.lambda) = | ||
(* Actually simplify_lets is kind of global optimization since it requires you | ||
to know whether it's used or not *) | ||
let compile_coercion ~output_prefix (lam : Lambda.lambda) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "coercion" mean in this context?
Co-authored-by: Javier Chávarri <javier.chavarri@gmail.com>
this is a good idea. I'll play with it this week. |
…optimizations-cmj
fixes #464
require
calls (as they're computed before all theJ.program
optimizations run)..cmj
files too. So we can't just do it when emitting the.js